package com.svpino.netflix.parsers;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;

import com.svpino.netflix.ProxyImpl;
import com.svpino.netflix.model.Item;

public abstract class ListParser<T extends Item> extends OldParser {

	public ListParser(ProxyImpl connection) {
		super(connection);
	}

	public List<T> list(String... urls) {
		List<Element> elements = new ArrayList<Element>();
		for (String url : urls) {
			elements.add(request(url));
		}

		return list((Element[]) elements.toArray(new Element[0]));
	}

	public abstract List<T> list(Element... elements);

}
